The Sagely Fox

Home Index/Public Files About

Watching, Learning, Thinking

Delete undeletable file that does not exist

What finally worked to delete the UNDELETABLE FILE THAT DOES NOT EXIST:

Where R is the drive letter, zapped is the directory, (Wayward Children 5) Come Tumbling Down by Seanan McGuire is the file name that does not exist.

In my command prompt window at the prompt R:\>  I typed precisely the following:

del "\\?\R:\zapped\(Wayward Children 5) Come Tumbling Down by Seanan McGuire " 


I was on the root directory of my R drive. Your prompt may be different. As long as the correct info is in the command, it will not matter.


To delete the UNDELETABLE FILE THAT DOES NOT EXIST: Where the file is R:\zapped\(Wayward Children 5) Come Tumbling Down by Seanan McGuire

So the important command prompt entry is as follows (between the ticks) `del "\\?\xyz "` where xyz is the drive:\directory\filename --- seems important for the quotes and the extra space.

Maybe not the extra space, I'm uncertain. I think the reason I couldn't delete the file is there was that extra space in the name and only a few commands noticed it, or I discovered it had an extra space with an attempt to highlight the file and the highlight showed the extra space.

del "\\?\R:\zapped\(Wayward Children 5) Come Tumbling Down by Seanan McGuire "

Seems Windows Powershell has different commands as this will not work in Windows Powershell. Only worked in the normal windows command prompt.

To open the Windows command prompt: Hold the Windows key, press R. This opens a "run" window. Type in cmd.exe. [enter] It will open the command prompt. Then you can do the above procedure.

I would give a special thanks to Rayza73, but I had to find it explained on 10+ different pages before I could clearly understand it. It took hours. This page is my attempt to make it simpler for those struggling with the original answer which is apparently the only answer that I could find that works.

The answer at answers.microsoft.com where Frederik Long explained to me why \\?\ worked when nothing else would work. Thanks Frederick!

 

Home/2021 Reviews   Index/Public Files   TOP